<%@ page language="java" pageEncoding="UTF-8" buffer="16kb"%>
<%@ include file="/base.jsp"%>
<%@ include file="/module/taglibs.jsp"%>
<%@ include file="/module/nocache.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <%@ include file="/module/js.jsp"%>
    <script type="text/javascript" src="${basePath}/js/jquery.Huploadify.js"></script>
    <link href="${basePath}/css/Huploadify.css" rel="stylesheet">
    <script type="text/javascript" src="${basePath}/js/raty/jquery.raty.js"></script>
    <link href="${basePath}/js/raty/jquery.raty.css" rel="stylesheet">
    <style type="text/css">

        .list * {
            margin: 0;
            padding: 0;
            outline: none;
            list-style: none;
            box-sizing: border-box;
        }

        .list li {

            overflow: hidden;
            padding: 20px;
            border-bottom: 1px solid #efefef;
        }

        .list .list_left {
            float: left;
        }

        .list .list_right {
            float: right;
        }

        .list .list_content {
            padding-left: 200px;
            padding-right: 200px;
        }

        .list_pagination {
            padding: 20px;
            text-align: right;
            font-size: 0;
        }

        .list_pagination span {
            cursor: pointer;
            display: inline-block;
            vertical-align: middle;
            font-size: 14px;
            border: 1px solid #dfdfdf;
            min-width: 30px;
            padding: 0 10px;
            color: #333;
            height: 30px;
            font-weight: bold;
            line-height: 30px;
            text-align: center;
            background-color: #F5F4F4;
            margin-right: 10px;
        }

        .list_pagination span.is-selected {
            background-color: #34383A;
            color: #fff;
        }
        .list_pagination span.is-disabled {
            /*background-color: #34383A;*/
            color: #ccc;
            pointer-events: none;
            cursor: not-allowed;
        }
        .list_pagination span.is-ellipsis{
            border: 0;
            background-color: transparent;
        }
    </style>
    <script>
        //图片上传
        var file_path = "prefix";
        var file_path_one = null;
        var fileMap = new Array();
        $(document).ready(function() {
            $('#btnBack').click(function() {
                window.location.href = "${basePath}/partyActivity/list?hdType=${hdType}";
            });

            var json_dy_info = JSON.parse('${json}');
            var data_canjia = JSON.parse('${partyActivityMembersJSON}');
            var data_qingjia = JSON.parse('${partyActivityMembersQingjiaJSON}');
            if(data_canjia!=null && data_canjia.length>0){
                drawTable("tpl_dy","dy_list_info_id",data_canjia);
            }
            if(data_qingjia!=null && data_qingjia.length>0){
                drawTable("tpl_dy_qingjia","dy_qingjia_list_info_id",data_qingjia);
            }


            $('#tt').tabs({
                border:false,
                onSelect:function(title){
                    if(title=='评价'){
                        //加载评论分页数据
                        goPage('1');
                    }
                }
            });


            $("#div1").dialog({
                width : 'auto',
                height : 'auto',
                bgiframe : true,
                modal : true,
                draggable : true,
                resizable : false,
                title : '选择参与人员',
                autoOpen : false,
                buttons : {
                    '取消' : function() {
                        $(this).dialog('close');
                    },
                    '确定' : function() {
                        var data = [];
                        var selected_item = document.getElementById("toSelect");
                        var flag = $("#flag").val();
                        if(selected_item.length==null || selected_item.length==0){
                            alert("请选择一项");
                            return false;
                        }
                        for(var i=0;i<selected_item.length;i++){
                            var dy_id = selected_item.options[i].value;
                            for(var j=0;j<json_dy_info.length;j++){
                                if(dy_id==json_dy_info[j].dYID){
                                    data.push({//往对象的末尾添加一个对象
                                        xM: json_dy_info[j].xM,
                                        dYID: json_dy_info[j].dYID,
                                        xB: json_dy_info[j].xB,
                                        partyBranch: json_dy_info[j].partyBranch.dZBMC
                                    });
                                }
                            }
                        }
                        //初始化表格数据
                        if(flag==1) {//参与人员
                            data_canjia = getTargetJSON(data,data_canjia);
                            drawTable("tpl_dy","dy_list_info_id",data_canjia);
                        }else if(flag==2){//请假人员
                            data_qingjia = getTargetJSON(data,data_qingjia);
                            drawTable("tpl_dy_qingjia","dy_qingjia_list_info_id",data_qingjia);
                        }
                        $("#div1").dialog('close');
                    }
                }
            });

            $("#delSelect").click(function(){
                var iii = $.getSelectIds('dyItems');
                if(iii.length==0){
                    alert('请至少选择一项删除');
                    return false;
                }
                $("input:checkbox[name='dyItems']:checked").each(function() {
                    removeObjFromJSON($(this).val(),data_canjia);
                });
                drawTable("tpl_dy","dy_list_info_id",data_canjia);
            });

            $("#delSelect1").click(function(){
                var iii = $.getSelectIds('dyItems1');
                if(iii.length==0){
                    alert('请至少选择一项删除');
                    return false;
                }
                $("input:checkbox[name='dyItems1']:checked").each(function() {
                    removeObjFromJSON($(this).val(),data_qingjia);
                });
                drawTable("tpl_dy_qingjia","dy_qingjia_list_info_id",data_qingjia);
            });

            $.select2("selectall","dyItems");
            $.select2("selectall1","dyItems1");


            //基本信息保存
            var _form=$("#partyActivityForm").validate();
            $("#btnSave").click(function() {
                if(_form.form()){
                    $("#addType").val("1");
                    $("#partyActivityForm").attr("action","${basePath}/partyActivity/modify");
                    $("#partyActivityForm").submit();
                }
            });

            //保存基本信息并添加
            $("#btnSaveToAdd").click(function() {
                if(_form.form()){
                    $("#addType").val("2");
                    $("#partyActivityForm").attr("action","${basePath}/partyActivity/modify");
                    $("#partyActivityForm").submit();
                }
            });

            //保存成功返回列表页面（过程记录）
            $("#btnSave2Index").click(function() {
                var _form=$("#partyActivityForm").validate();
                if(_form.form()){
                    $("#partyActivityForm").attr("action","${basePath}/partyActivity/saveActivityAtt");
                    $("#partyActivityForm").submit();
                }
            });

            //保存评论内容
            $("#btnSave3Index").click(function() {
                var _form=$("#partyActivityForm").validate();
                if(_form.form()){
                    $("#partyActivityForm").attr("action","${basePath}/partyActivity/addPartyActivityComment");
                    $("#partyActivityForm").submit();
                }
            });


            //文件上传(过程记录)
            var up = $('#uploadadd').Huploadify({
                auto:false,
                fileTypeExts:'*.*',
                multi:true,
                formData:{key:123456,key2:'vvvv'},
                fileSizeLimit:99999999999,
                showUploadedPercent:true,
                showUploadedSize:true,
                removeTimeout:9999999,
                uploader : '${basePath}/partyActivity/source_upload',
                onUploadStart:function(file){
                    console.log(file.name+'开始上传');
                },
                onInit:function(obj){
                    console.log('初始化');
                    console.log(obj);
                },
                onUploadComplete:function(file,data){
                    debugger;
                    var fi = $.parseJSON(data);
                    //文件名称
                    var filename = fi.filename;
                    //生成后的文件名
                    var sysFilepath = fi.sysfilepath;
                    //文件路径
                    var filepath = fi.filepath;
                    file_path_one = filename + "," + filepath;
                    file_path = file_path+"|"+filepath;
                    up.filePath=file_path_one;
                    //保存到集合
                    fileMap[file.index]=new Array(file_path_one);
                },
                onCancel:function(file){
                    console.log(file.name+'删除成功');
                },
                onClearQueue:function(queueItemCount){
                    console.log('有'+queueItemCount+'个文件被删除了');
                },
                onDestroy:function(){
                    console.log('destroyed!');
                },
                onSelect:function(file){
                    console.log(file.name+'加入上传队列');
                },
                onQueueComplete:function(queueData){
                    console.log('队列中的文件全部上传完成',queueData);
                }
            });



            //文件上传(评价)
            var up = $('#uploadadd1').Huploadify({
                auto:false,
                fileTypeExts:'*.*',
                multi:true,
                formData:{key:123456,key2:'vvvv'},
                fileSizeLimit:99999999999,
                showUploadedPercent:true,
                showUploadedSize:true,
                removeTimeout:9999999,
                uploader : '${basePath}/partyActivity/source_upload',
                onUploadStart:function(file){
                    console.log(file.name+'开始上传');
                },
                onInit:function(obj){
                    console.log('初始化');
                    console.log(obj);
                },
                onUploadComplete:function(file,data){
                    debugger;
                    var fi = $.parseJSON(data);
                    //文件名称
                    var filename = fi.filename;
                    //生成后的文件名
                    var sysFilepath = fi.sysfilepath;
                    //文件路径
                    var filepath = fi.filepath;
                    file_path_one = filename + "," + filepath;
                    file_path = file_path+"|"+filepath;
                    up.filePath=file_path_one;
                    //保存到集合
                    fileMap[file.index]=new Array(file_path_one);
                },
                onCancel:function(file){
                    console.log(file.name+'删除成功');
                },
                onClearQueue:function(queueItemCount){
                    console.log('有'+queueItemCount+'个文件被删除了');
                },
                onDestroy:function(){
                    console.log('destroyed!');
                },
                onSelect:function(file){
                    console.log(file.name+'加入上传队列');
                },
                onQueueComplete:function(queueData){
                    console.log('队列中的文件全部上传完成',queueData);
                }
            });


            //初始化打分星星
            $('#starBg').raty({
                starOff : '${basePath}/js/raty/images/star-off.png',
                starOn  : '${basePath}/js/raty/images/star-on.png',
                targetScore: '#stars'
            });

        });
        function showdiv(flag) {
            $("#flag").val(flag);
            $("#toSelect").empty();
            $('#div1').dialog('open');
        }


        //判断是否已经存在该元素值
        function getTargetJSON(fromJSON,toJSON){
            if(toJSON==null || toJSON.length==0){
                toJSON = fromJSON;
            }else{
                for(var i=0;i<fromJSON.length;i++){
                    var dyID = fromJSON[i].dYID;
                    var isExist = 0;
                    for(var j=0;j<toJSON.length;j++){
                        if(dyID==toJSON[j].dYID){
                            isExist=1;
                        }
                    }
                    if(isExist==1){
                        toJSON.push(fromJSON[i]);
                    }
                }
            }
            return toJSON;
        }

        //从JSON中移除某个对象
        function removeObjFromJSON(dyID,targetJSON) {
            for(var i=0;i<targetJSON.length;i++){
                if(targetJSON[i].dYID == dyID) {
                    targetJSON.splice(i,1);
                }
            }
        }

        //输出表格数据
        function drawTable(tplId,table_id,data) {
            $("#"+table_id).html('');
            for(var k=0;k<data.length;k++){
                data[k].iindex = k;
                var html = template(tplId,data[k]);
                $("#"+table_id).html($("#"+table_id).html()+html);
            }
        }

        //评论分页
        function goPage(page){
            $.ajax({
                type: "GET",
                url: "${basePath}/partyActivity/listCommentsData",
                data: {
                    hDID:$("#hDID").val(),
                    page:page
                },
                dataType: "json",
                success: function(data){
                    var _html = template("tpl_comments_id",data);
                    $("#comments_list").html(_html);
                }
            });
        }


    </script>
    <style type="text/css">
        .grid{font:12px arial,helvetica,sans-serif;border:1px solid #cccccc}
        .grid td{font:100% arial,helvetica,sans-serif;height:24px;padding:5px}
        .grid{width:100%;border-collapse:collapse}.grid th{background:#eeeeee;height:27px;line-height:27px;border:1px solid #cccccc;padding-left:5px}
        .grid td{border:1px solid #cccccc;padding-left:5px;text-align: center;}
    </style>
</head>
<body>
<div style="text-align: center;padding-bottom: 20px;">
    <c:choose>
        <c:when test="${hdType==1}">
            <span class="table-header">固定日活动</span>
        </c:when>
        <c:when test="${hdType==2}">
            <span class="table-header">社区服务与志愿参与</span>
        </c:when>
        <c:when test="${hdType==3}">
            <span class="table-header">宣传思想工作情况</span>
        </c:when>
        <c:when test="${hdType==4}">
            <span class="table-header">廉政建设分析会</span>
        </c:when>
    </c:choose>
</div>
<form action="#" id="partyActivityForm" name="partyActivityForm">
<div id="tt" style="width:auto;height:auto;">
    <div title="基本信息" style="overflow:auto;padding:20px;">
            <input type="hidden" name="token" value="${token}" />
            <input type="hidden" name="selected_item_ids" id="selected_item_ids" value=""/>
            <input type="hidden" name="flag" id="flag" value=""/>
            <input type="hidden" name="hdType" id="hdType" value="${hdType}"/>
            <input type="hidden" name="addType" id="addType" value=""/>
            <input type="hidden" name="hDID" id="hDID" value="${partyActivity.hDID}"/>
            <table cellpadding="0" cellspacing="0" border="0" class="table-border"
                   width="80%">
                <tr>
                    <td class="table-titleTD" style="width: 20%"><font
                            style="color: red;">*</font>活动名称：</td>
                    <td class="table-contentTD" style="width: 30%">
                        <input type="text" id="hDMC" name="hDMC" value="${partyActivity.hDMC}" maxlength="50" class="inputText required" placeholder="请输入活动名称"/>
                    </td>
                    <td class="table-titleTD" style="width: 20%"><font
                            style="color: red;">*</font>活动日期：</td>
                    <td class="table-contentTD" style="width: 30%">
                        <input name="hDRQ" id="hDRQ"  autocomplete="off" readonly="readonly" 
                        value="${partyActivity.hDRQ}"
                               class="Wdate required inputText" onFocus="WdatePicker({dateFmt:'yyyy-MM-${partyFixedDateActivityDay}'})"/>
                    </td>
                </tr>
                <tr>
                    <td class="table-titleTD"><font style="color: red;">*</font>活动时间：</td>
                    <td class="table-contentTD"><input type="text" id="hDSJ"
                                                       name="hDSJ" value="${partyActivity.hDSJ}" maxlength="50" class="inputText required"  placeholder="请输入时间"/></td>

                    <td class="table-titleTD"><font style="color: red;">*</font>活动地点：</td>
                    <td class="table-contentTD"><input type="text" id="hDDD"
                                                       name="hDDD" value="${partyActivity.hDDD}" maxlength="50"  class="inputText required"  placeholder="请输入活动地点"/></td>
                </tr>
                <tr>
                    <td class="table-titleTD"><font style="color: red;">*</font>活动主题：</td>
                    <td class="table-contentTD" colspan="3">
                        <input type="text" id="hDZT" name="hDZT" value="${partyActivity.hDZT}" maxlength="100"  class="inputText required" placeholder="请输入活动主题"/></td>
                </tr>
                <tr>
                    <td class="table-titleTD"><font style="color: red;">*</font>活动内容：</td>
                    <td class="table-contentTD" colspan="3">
                        <textarea rows="8" cols="50"  id="hDNR" name="hDNR" maxlength="1000" class="inputText required" placeholder="请输入活动内容">${partyActivity.hDNR}</textarea>
                    </td>
                </tr>
                <tr>
                    <td class="table-titleTD">参与人员：</td>
                    <td class="table-contentTD" colspan="3">
                        <input type="button" id="btnSelect" value="选择"
                               class="inputButton" onclick="javascript:showdiv('1');"/>
                        <input type="button" id="delSelect" value="删除"
                               class="inputButton"/>
                    </td>
                </tr>
                <tr>
                    <td colspan="4">
                        <table class="grid" id="tb_dy_id">
                            <thead>
                            <tr>
                                <th><input type="checkbox" name="selectall" id="selectall" /></th>
                                <th>序号</th>
                                <th>姓名</th>
                                <th>性别</th>
                                <th>所在党支部</th>
                            </tr>
                            </thead>
                            <tbody id="dy_list_info_id">

                            </tbody>
                        </table>
                    </td>
                </tr>


                <tr>
                    <td class="table-titleTD">请假人员：</td>
                    <td class="table-contentTD" colspan="3">
                        <input type="button" id="btnSelect1" value="选择"
                               class="inputButton" onclick="javascript:showdiv('2');"/>
                        <input type="button" id="delSelect1" value="删除"
                               class="inputButton"/>
                    </td>
                </tr>
                <tr>
                    <td colspan="4">
                        <table class="grid" id="tb_dy_qingjia_id">
                            <thead>
                            <tr>
                                <th><input type="checkbox" name="selectall1" id="selectall1" /></th>
                                <th>序号</th>
                                <th>姓名</th>
                                <th>性别</th>
                                <th>所在党支部</th>
                                <th>请假类别</th>
                                <th>请假事由</th>
                            </tr>
                            </thead>
                            <tbody id="dy_qingjia_list_info_id">

                            </tbody>
                        </table>
                    </td>
                </tr>

            </table>

            <script id="tpl_dy" type="text/html">
                <tr id="tr_{{dYID}}">
                    <td>&nbsp;<input type="checkbox" name="dyItems" value="{{dYID}}"/></td>
                    <td>{{iindex+1}}</td>
                    <td>{{xM}}</td>
                    <td>{{xB}}</td>
                    <td>
                        {{partyBranch}}
                        <input type="hidden" name="partyActivityMembers[{{iindex}}].dYID" value="{{dYID}}"/>
                        <input type="hidden" name="partyActivityMembers[{{iindex}}].memberType" value="1"/>
                    </td>
                </tr>
            </script>

            <script id="tpl_dy_qingjia" type="text/html">
                <tr id="tr_qingjia_{{dYID}}">
                    <td>&nbsp;<input type="checkbox" name="dyItems1" value="{{dYID}}"/></td>
                    <td>{{iindex+1}}</td>
                    <td>{{xM}}</td>
                    <td>{{xB}}</td>
                    <td>{{partyBranch}}</td>
                    <td>
                        <select name="partyActivityMembersQingjia[{{iindex}}].qJLB">
                            <option value="公假" {{if qJLB == '公假'}}selected="selected"{{/if}} >公假</option>
                            <option value="私假" {{if qJLB == '私假'}}selected="selected"{{/if}}	>私假</option>
                            <option value="病假" {{if qJLB == '病假'}}selected="selected"{{/if}}	>病假</option>
                        </select>
                    </td>
                    <td style="width: 300px;">
                        <input type="hidden" name="partyActivityMembersQingjia[{{iindex}}].dYID" value="{{dYID}}"/>
                        <input type="hidden" name="partyActivityMembersQingjia[{{iindex}}].memberType" value="2"/>
                        <input type="text" style="width: 280px;" name="partyActivityMembersQingjia[{{iindex}}].qJYY" value="{{qJYY}}"/>
                    </td>
                </tr>
            </script>

            <br />
            <table cellpadding="1" cellspacing="1" border="0" align="left">
                <tr>
					 <td><input type="button" id="btnSave" class="inputButton" style="text-align: center;" value="保存" /></td>
					<td><input type="button" id="Cancel2" class="inputButton" style="text-align: center;" value="取消" onclick="cancle()"/></td>
					<td><input type="button" id="returnBut2" class="inputButton" value="返回" style="text-align: center;" onclick="back2Index()" /></td>          
                </tr>
            </table>

            <div id="div1" style="display: none;">
                <table cellpadding="0" cellspacing="0" border="0"
                       class="table-border">

                    <tr>
                        <td style="clear:both; width: 45%">
                            <input class="text" name="searchemp" ondblclick="javascript:filterSelectItems('sourseFromSelect2','fromSelect','fromSelect',this.value);"  onkeyup="javascript:filterSelectItems('sourseFromSelect2','fromSelect','fromSelect',this.value);"/><font color="green">在此查找</font> <br/>
                            <br/><label style="color:red;">未选中:</label><br/>
                            <select name="fromSelect" id="fromSelect" multiple="multiple" style="width:400px; height: 300px;"
                                    ondblclick="moveField('fromSelect','toSelect');">
                                <c:forEach items="${partyLeagueMember}" var="data">
                                    <option value="${data.dYID}">${data.xM}</option>
                                </c:forEach>
                            </select>
                            <select name="sourseFromSelect2" id="sourseFromSelect2" multiple="multiple" style="width: 220px; height: 150px; display: none;" >
                                <c:forEach items="${partyLeagueMember}" var="data">
                                    <option value="${data.dYID}">${data.xM}</option>
                                </c:forEach>
                            </select>
                        </td>
                        <td align="center" style="width: 10%">
                            <input type="button"  onclick="moveAllField('fromSelect','toSelect');" style="width: 50px;" value=">>" />
                            <br>
                            <br/>
                            <input type="button"
                                   onclick="moveField('fromSelect','toSelect');"
                                   style="width: 50px;" value=">" />
                            <br/>
                            <br/>
                            <input type="button"   style="width: 50px;" value="&lt" onclick="moveField('toSelect','fromSelect');"/><br/> <br/>
                            <input type="button" style="width: 50px;" onclick="moveAllField('toSelect','fromSelect');"  value="&lt&lt" />
                        </td>
                        <td style="width: 45%"><br/><label style="color:red;">已选中:</label><br/>
                            <select name="toSelect" id="toSelect" multiple="multiple"  class="text"   style="width:400px;height: 300px;" ondblclick="moveField('toSelect','fromSelect');">
                            </select>
                        </td>

                    </tr>
                </table>
            </div>
    </div>
    <div title="过程记录" style="overflow:auto;padding:20px;">
        <table cellpadding="0" cellspacing="0" border="0" class="table-border"
               width="80%">
            <tr>
            <tr>
                <td class="table-titleTD">附件：</td>
                <td class="table-contentTD" colspan="3">
                    <table>
                        <tr>
                            <td colspan="2">
                                <div id="uploadadd"></div>
                            </td>
                        </tr>
                        <c:if test="${fn:length(dataList) > 0}">
                            <c:forEach items="${dataList}" var="datalist" varStatus="index">
                                <tr>
                                    <td>
                                        [文件] ${datalist.fileName}
                                    </td>
                                    <td>
                                        <a href="${basePath}/DownLoadFileServlet?filename=${datalist.fileName}&filepath=${datalist.filePath}">下载</a>

                                            <%-- <button type="button"  onclick="window.location.href='${basePath}/DownLoadFileServlet?filename=${datalist.fileName}&filepath=${datalist.filePath}'">下载</button> --%>
                                        &nbsp;&nbsp;

                                        <button id="${datalist.fileId}_hr" type="button"  onclick="deleteByPK('${datalist.fileId}','${datalist.filePath}');">删除</button>
                                    </td>
                                </tr>
                            </c:forEach>
                        </c:if>
                    </table>
                </td>
            </tr>
            </tr>
            <tr>
                <td class="table-titleTD" style="width: 30%">
                    记录内容：
                </td>
                <td class="table-contentTD" style="width: 70%">
                    <textarea rows="10" cols="40" name="gCJL">${partyActivity.gCJL}</textarea>
                </td>
            </tr>
        </table>
        <table cellpadding="1" cellspacing="1" border="0" align="left">
            <tr>
                <td><input type="button" id="btnSave2Index" class="inputButton" style="text-align: center;" value="保存" /></td>
                <td><input type="button" id="Cancel2" class="inputButton" style="text-align: center;" value="取消" onclick="cancle()"/></td>
                <td><input type="button" id="returnBut2" class="inputButton" value="返回" style="text-align: center;" onclick="back2Index()" /></td>
            </tr>
        </table>
    </div>
    <div title="评价" style="overflow:auto;padding:20px;">
        <script id="tpl_comments_id" type="text/html">
            <ul>
                {{each pageList as value index}}
                    <li>
                        <div class="list_right">
                            {{each value.partyActivityCommentAttrAttList as svalue}}
                            {{svalue.fileName}}&nbsp;&nbsp;<a href="${basePath}/DownLoadFileServlet?filename={{svalue.fileName}}&filepath={{svalue.filePath}}">下载</a>
                            <br/>
                            {{/each}}
                        </div>
                        <div class="list_left" style="text-align: center;">
                            <div>
                                {{value.dYXM}}
                            </div>
                            <div style="margin-top: 5px;text-align: left">
                                {{#value.starString}}
                            </div>
                            <div style="margin-top: 5px;">
                                {{value.timeString}}
                            </div>
                        </div>
                        <div class="list_content">
                            {{value.contents}}
                        </div>
                    </li>
                {{/each}}
            </ul>
            <div class="list_pagination">
                <span>{{currentPage}}/{{totalPage}}</span>
                {{if currentPage==1}}
                    <span class="is-disabled" onclick="goPage('{{totalPage}}');">上一页</span>
                {{else}}
                    <span onclick="goPage('{{currentPage - 1}}');">上一页</span>
                {{/if}}
                {{if currentPage == totalPage}}
                    <span class="is-disabled" onclick="goPage('{{totalPage}}');">下一页</span>
                {{else}}
                    <span onclick="goPage('{{currentPage + 1 }}');">下一页</span>
                {{/if}}
            </div>
        </script>
        <div class="list" id="comments_list">
        </div>
        <table cellpadding="0" cellspacing="0" border="0" class="table-border"
               width="80%">
            <tr>
                <td class="table-titleTD" style="width: 30%">
                    <fontstyle="color: red;">*</font>星级：
                </td>
                <td class="table-contentTD" style="width: 70%;text-align: left;">
                    <div id="starBg">

                    </div>
                    <input type="hidden" name="stars" id="stars" value=""/>
                </td>
            </tr>
            <tr>
                <td class="table-titleTD">附件：</td>
                <td class="table-contentTD" colspan="3">
                    <table>
                        <tr>
                            <td colspan="2">
                                <div id="uploadadd1"></div>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td class="table-titleTD" style="width: 30%">
                    <fontstyle="color: red;">*</font>评价内容：
                </td>
                <td class="table-contentTD" style="width: 70%">
                    <textarea rows="10" cols="60" name="contents"></textarea>
                </td>
            </tr>
        </table>
        <table cellpadding="1" cellspacing="1" border="0" align="left">
            <tr>
                <td><input type="button" id="btnSave3Index" class="inputButton" style="text-align: center;" value="保存" /></td>
                <td><input type="button" id="Cancel3" class="inputButton" style="text-align: center;" value="取消" onclick="cancle()"/></td>
                <td><input type="button" id="returnBut3" class="inputButton" value="返回" style="text-align: center;" onclick="back2Index()" /></td>
            </tr>
        </table>
    </div>
</div>
</form>

<script>
		$(document).ready(function() {
			
			//保存成功返回详情页面
			$("#btnSave2Info").click(function() {
				var _form=$("#Form").validate();
				if(_form.form()){
					$("#urlTp").attr("value",1);
					document.Form.action ="${basePath}/schoolTraining/save";
					document.Form.submit();
				}
			});
			
			//保存成功继续增加页面
			$("#btnSave2AddInint").click(function() {
				var _form=$("#Form").validate();
				if(_form.form()){
					$("#urlTp").attr("value",2);
					document.Form.action ="${basePath}/schoolTraining/save";
					document.Form.submit();
				}
			});
			
			
			//保存成功返回列表页面
			$("#btnSave2Index").click(function() {
				var _form=$("#Form").validate();
				if(_form.form()){
					$("#urlTp").attr("value",3);
					document.Form.action ="${basePath}/schoolTraining/save";
					document.Form.submit();
				}
			});
			
		});
		
		
		//取消->当前页面刷新
		function cancle(){
			window.location.reload();//刷新当前页面.
		}
		
		//返回列表页面
		function back2Index(){
			window.location.href = "${basePath}/partyActivity/list?hdType=${hdType}";
		}
		
	   	if("${msg}"!=""){
		   	layer.alert("${msg}", {icon: 6});
	  	}
		//compareListValue(document.getElementById('mz'),'${student.mz}');
	</script>
	
</body>
</html>
